#ifndef __WEAPON_H
#define __WEAPON_H

#include "Base.h"
#include "WMovingObject.h"

class Player;

class Weapon : public WMovingObject {

protected:
	double rechargeTime, maxLife, lifeDone;

public:
	
	virtual Weapon * generate (Player *p) = 0;
	Weapon (const double strength, const double rechargeTime, const Point3d &velocity, const Point3d &pos) 
	: WMovingObject(pos, velocity, 1.0,1.0), rechargeTime(rechargeTime) {
		this->setLife(1.0);
		this->setStrength(strength);
		this->maxLife = 50.0;
		this->lifeDone = 0;
	}
	
	virtual ~Weapon () { }
	
	double getRechargeTime () { return rechargeTime; }
	
	void modifyRechargeTime (double value) { 
		rechargeTime += value; 
		if (rechargeTime < 1.0)
			rechargeTime = 1.0;
	}
	
	void setMaxLife (double maxLife) { this->maxLife = maxLife; }
	double getMaxLife () const { return this->maxLife; }
		
	void modifyStrength (double value) { strength += value; }
	
};
#endif